package com.example.mybatis.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.example.mybatis.entity.Enum.UserSexEnum;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author Devil
 * @create 2022-03-04 10:47
 */
@Data
@TableName(autoResultMap = true)
public class User {

    @TableId(type = IdType.AUTO)
    private Integer id;

    private String name;

    /**
     * 配置为通用枚举
     */
    @TableField(fill= FieldFill.INSERT)
    private UserSexEnum sex;

    /**
     * 给逻辑删除字段加上@TableLogic注解 使其生效
     */
    @TableLogic(value = "0",delval = "1")
    private Integer deleted;
}
